<%@ taglib prefix="s" uri="/struts-tags" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<h2>Liste catégories</h2>

<table border="1">
    <tr>
        <th width="200">id</th>
        <th width="200">Libelle</th>
        <th>Modifier</th>
        <th>Supprimer</th>
    </tr>

    <c:forEach var="categorie" items="${categories}">
        <tr>
            <td>
                <s:url var="url" action="voirCategorie">
                    <s:param name="idCategorie">${categorie.id}</s:param>
                </s:url>
                <s:a href="%{url}">${categorie.id}</s:a>
            </td>
            <td>${categorie.libelle}</td>
            <td>
                <s:url var="url" action="modifierCategorieForm">
                    <s:param name="idCategorie">${categorie.id}</s:param>
                </s:url>
                <s:a href="%{url}">Modifier</s:a>
            </td>
            <td>
                <s:url var="url" action="supprimerCategorie">
                    <s:param name="idCategorie">${categorie.id}</s:param>
                </s:url>
                <s:a href="%{url}">Supprimer</s:a>
            </td>
        </tr>
    </c:forEach>
</table>

